package org.cshoo.sys.command
{
	import com.adobe.cairngorm.commands.ICommand;
	import com.adobe.cairngorm.control.CairngormEvent;
	import mx.controls.Alert;
	import mx.rpc.events.ResultEvent;
	import mx.rpc.IResponder;
	
	import org.cshoo.sys.business.ParameterDelegate;
	import org.cshoo.sys.event.UpdateParameterEvent;
	import org.cshoo.sys.model.vo.Parameter;
	
	import org.cshoo.common.consts.MessageType;
	
	public class UpdateParameterCommand implements ICommand, IResponder
	{
		
		public function execute(event:CairngormEvent):void
		{
			var parameter:Parameter = (event as UpdateParameterEvent).parameter;
			var parameterDelegate:ParameterDelegate = new ParameterDelegate(this);
			parameterDelegate.updateParameter(parameter);
		}
		
		public function result(event:Object):void
		{
			if((event as ResultEvent).result as Boolean)
			{
			}
			else
				Alert.show("保存失败");
		}
		
		public function fault(info:Object):void
		{
			Alert.show("保存失败");
		}
	}
}